By Daniel Luu and Jorge Gamboa
We will be comparing both the total housing units from parcel and census data because the discrepancy can point to possible excess units being
Make sure to import pandas in order to work and read csv data
# Bring in pandas to work with csv data
import pandas as pd
# Load csv data into python
df = pd.read_csv('housingunits.csv')
Do any initial data check to see what we are working with
# Check how large csv file is
df.shape
(2346, 160)
# Do an initial look at the first few data rows
df.head(10)
| Geo_FIPS | Geo_GEOID | Geo_NAME | Geo_QName | Geo_STUSAB | Geo_SUMLEV | Geo_GEOCOMP | Geo_FILEID | Geo_LOGRECNO | Geo_US | ... | SE_A10027_017 | SE_A10030_001 | SE_A10030_002 | SE_A10030_003 | SE_A10030_004 | SE_A10030_005 | SE_A10030_006 | SE_A10030_007 | ACS18_5yr_B25001001 | ACS18_5yr_B25001001s | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 6037101110 | 14000US06037101110 | Census Tract 1011.10 | Census Tract 1011.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3870 | NaN | ... | 74 | 1596 | 123 | 603 | 501 | 277 | 67 | 25 | 1743 | 26.666670 |
| 1 | 6037101122 | 14000US06037101122 | Census Tract 1011.22 | Census Tract 1011.22, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3871 | NaN | ... | 23 | 1256 | 7 | 349 | 548 | 199 | 136 | 17 | 1391 | 12.121210 |
| 2 | 6037101210 | 14000US06037101210 | Census Tract 1012.10 | Census Tract 1012.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3872 | NaN | ... | 75 | 2321 | 287 | 1137 | 700 | 189 | 8 | 0 | 2402 | 33.939390 |
| 3 | 6037101220 | 14000US06037101220 | Census Tract 1012.20 | Census Tract 1012.20, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3873 | NaN | ... | 0 | 1294 | 113 | 544 | 419 | 136 | 29 | 53 | 1328 | 26.060610 |
| 4 | 6037101300 | 14000US06037101300 | Census Tract 1013 | Census Tract 1013, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3874 | NaN | ... | 6 | 1435 | 66 | 291 | 575 | 261 | 211 | 31 | 1584 | 26.060610 |
| 5 | 6037101400 | 14000US06037101400 | Census Tract 1014 | Census Tract 1014, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3875 | NaN | ... | 64 | 1473 | 121 | 368 | 682 | 204 | 83 | 15 | 1614 | 24.242420 |
| 6 | 6037102103 | 14000US06037102103 | Census Tract 1021.03 | Census Tract 1021.03, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3876 | NaN | ... | 23 | 696 | 8 | 241 | 266 | 131 | 50 | 0 | 726 | 7.878788 |
| 7 | 6037102104 | 14000US06037102104 | Census Tract 1021.04 | Census Tract 1021.04, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3877 | NaN | ... | 25 | 1270 | 83 | 410 | 505 | 117 | 113 | 42 | 1345 | 24.242420 |
| 8 | 6037102105 | 14000US06037102105 | Census Tract 1021.05 | Census Tract 1021.05, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3878 | NaN | ... | 6 | 563 | 8 | 203 | 213 | 72 | 32 | 35 | 589 | 9.696970 |
| 9 | 6037102107 | 14000US06037102107 | Census Tract 1021.07 | Census Tract 1021.07, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3879 | NaN | ... | 35 | 1305 | 51 | 218 | 570 | 285 | 139 | 42 | 1352 | 20.606060 |
10 rows × 160 columns
Change how we will view and use the data
# Override data row and column limit
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
# Do a sample data to confirm override
df.sample()
| Geo_FIPS | Geo_GEOID | Geo_NAME | Geo_QName | Geo_STUSAB | Geo_SUMLEV | Geo_GEOCOMP | Geo_FILEID | Geo_LOGRECNO | Geo_US | Geo_REGION | Geo_DIVISION | Geo_STATECE | Geo_STATE | Geo_COUNTY | Geo_COUSUB | Geo_PLACE | Geo_PLACESE | Geo_TRACT | Geo_BLKGRP | Geo_CONCIT | Geo_AIANHH | Geo_AIANHHFP | Geo_AIHHTLI | Geo_AITSCE | Geo_AITS | Geo_ANRC | Geo_CBSA | Geo_CSA | Geo_METDIV | Geo_MACC | Geo_MEMI | Geo_NECTA | Geo_CNECTA | Geo_NECTADIV | Geo_UA | Geo_UACP | Geo_CDCURR | Geo_SLDU | Geo_SLDL | Geo_VTD | Geo_ZCTA3 | Geo_ZCTA5 | Geo_SUBMCD | Geo_SDELM | Geo_SDSEC | Geo_SDUNI | Geo_UR | Geo_PCI | Geo_TAZ | Geo_UGA | Geo_BTTR | Geo_BTBG | Geo_PUMA5 | Geo_PUMA1 | SE_A10024_001 | SE_A10024_002 | SE_A10024_003 | SE_A10024_004 | SE_A10024_005 | SE_A10024_006 | SE_A10024_007 | SE_A10024_008 | SE_A10023_001 | SE_A10023_002 | SE_A10023_003 | SE_A10020_001 | SE_A10020_002 | SE_A10020_003 | SE_A10020_004 | SE_A10020_005 | SE_A10020_006 | SE_A10020_007 | SE_A10020_008 | SE_A10020_009 | SE_A10020_010 | SE_A10021_001 | SE_A10021_002 | SE_A10021_003 | SE_A10021_004 | SE_A10021_005 | SE_A10026_001 | SE_A10026_002 | SE_A10026_003 | SE_A10026_004 | SE_A10026_005 | SE_A10026_006 | SE_A10026_007 | SE_A10026_008 | SE_A10026_009 | SE_A10026_010 | SE_A10026_011 | SE_A10026_012 | SE_A10026_013 | SE_A10026_014 | SE_A10026_015 | SE_A10026_016 | SE_A10026_017 | SE_A10026_018 | SE_A10026_019 | SE_A10026_020 | SE_A10026_021 | SE_A10026_022 | SE_A10026_023 | SE_A10001_001 | SE_A10032_001 | SE_A10032_002 | SE_A10032_003 | SE_A10032_004 | SE_A10032_005 | SE_A10032_006 | SE_A10032_007 | SE_A10032_008 | SE_A10032_009 | SE_A10032_010 | SE_A10032_011 | SE_A10032_012 | SE_A10053B_001 | SE_A10053B_002 | SE_A10053B_003 | SE_A10053B_004 | SE_A10053B_005 | SE_A10053B_006 | SE_A10053B_007 | SE_A10053B_008 | SE_A10053B_009 | SE_A10053B_010 | SE_A10053B_011 | SE_A10028_001 | SE_A10028_002 | SE_A10028_003 | SE_A10028_004 | SE_A10028_005 | SE_A10028_006 | SE_A10027_001 | SE_A10027_002 | SE_A10027_003 | SE_A10027_004 | SE_A10027_005 | SE_A10027_006 | SE_A10027_007 | SE_A10027_008 | SE_A10027_009 | SE_A10027_010 | SE_A10027_011 | SE_A10027_012 | SE_A10027_013 | SE_A10027_014 | SE_A10027_015 | SE_A10027_016 | SE_A10027_017 | SE_A10030_001 | SE_A10030_002 | SE_A10030_003 | SE_A10030_004 | SE_A10030_005 | SE_A10030_006 | SE_A10030_007 | ACS18_5yr_B25001001 | ACS18_5yr_B25001001s | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1291 | 6037431300 | 14000US06037431300 | Census Tract 4313 | Census Tract 4313, Los Angeles County, California | ca | 140 | 0 | ACSSF | 5161 | NaN | NaN | NaN | NaN | 6 | 37 | NaN | NaN | NaN | 431300 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 841 | 127 | 263 | 145 | 171 | 110 | 18 | 7 | 841 | 227 | 614 | 841 | 9 | 101 | 172 | 226 | 93 | 62 | 115 | 35 | 28 | 841 | 52 | 149 | 309 | 331 | 841 | 81 | 0 | 0 | 81 | 74 | 11 | 10 | 53 | 50 | 12 | 6 | 32 | 128 | 37 | 0 | 91 | 500 | 299 | 122 | 79 | 8 | 0 | 910 | 910 | 802 | 764 | 38 | 0 | 40 | 26 | 10 | 21 | 11 | 0 | 0 | 289 | 177 | 18 | 0 | 35 | 22 | 10 | 16 | 11 | 0 | 0 | 841 | 519 | 310 | 10 | 0 | 2 | 841 | 0 | 8 | 12 | 20 | 24 | 33 | 32 | 49 | 29 | 5 | 73 | 146 | 177 | 104 | 129 | 0 | 841 | 13 | 190 | 365 | 136 | 84 | 53 | 910 | 16.36364 |
# look at the data types and what to clean out
df.info(verbose=True, null_counts=True)
<class 'pandas.core.frame.DataFrame'> RangeIndex: 2346 entries, 0 to 2345 Data columns (total 160 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Geo_FIPS 2346 non-null int64 1 Geo_GEOID 2346 non-null object 2 Geo_NAME 2346 non-null object 3 Geo_QName 2346 non-null object 4 Geo_STUSAB 2346 non-null object 5 Geo_SUMLEV 2346 non-null int64 6 Geo_GEOCOMP 2346 non-null int64 7 Geo_FILEID 2346 non-null object 8 Geo_LOGRECNO 2346 non-null int64 9 Geo_US 0 non-null float64 10 Geo_REGION 0 non-null float64 11 Geo_DIVISION 0 non-null float64 12 Geo_STATECE 0 non-null float64 13 Geo_STATE 2346 non-null int64 14 Geo_COUNTY 2346 non-null int64 15 Geo_COUSUB 0 non-null float64 16 Geo_PLACE 0 non-null float64 17 Geo_PLACESE 0 non-null float64 18 Geo_TRACT 2346 non-null int64 19 Geo_BLKGRP 0 non-null float64 20 Geo_CONCIT 0 non-null float64 21 Geo_AIANHH 0 non-null float64 22 Geo_AIANHHFP 0 non-null float64 23 Geo_AIHHTLI 0 non-null float64 24 Geo_AITSCE 0 non-null float64 25 Geo_AITS 0 non-null float64 26 Geo_ANRC 0 non-null float64 27 Geo_CBSA 0 non-null float64 28 Geo_CSA 0 non-null float64 29 Geo_METDIV 0 non-null float64 30 Geo_MACC 0 non-null float64 31 Geo_MEMI 0 non-null float64 32 Geo_NECTA 0 non-null float64 33 Geo_CNECTA 0 non-null float64 34 Geo_NECTADIV 0 non-null float64 35 Geo_UA 0 non-null float64 36 Geo_UACP 0 non-null float64 37 Geo_CDCURR 0 non-null float64 38 Geo_SLDU 0 non-null float64 39 Geo_SLDL 0 non-null float64 40 Geo_VTD 0 non-null float64 41 Geo_ZCTA3 0 non-null float64 42 Geo_ZCTA5 0 non-null float64 43 Geo_SUBMCD 0 non-null float64 44 Geo_SDELM 0 non-null float64 45 Geo_SDSEC 0 non-null float64 46 Geo_SDUNI 0 non-null float64 47 Geo_UR 0 non-null float64 48 Geo_PCI 0 non-null float64 49 Geo_TAZ 0 non-null float64 50 Geo_UGA 0 non-null float64 51 Geo_BTTR 0 non-null float64 52 Geo_BTBG 0 non-null float64 53 Geo_PUMA5 0 non-null float64 54 Geo_PUMA1 0 non-null float64 55 SE_A10024_001 2346 non-null int64 56 SE_A10024_002 2346 non-null int64 57 SE_A10024_003 2346 non-null int64 58 SE_A10024_004 2346 non-null int64 59 SE_A10024_005 2346 non-null int64 60 SE_A10024_006 2346 non-null int64 61 SE_A10024_007 2346 non-null int64 62 SE_A10024_008 2346 non-null int64 63 SE_A10023_001 2346 non-null int64 64 SE_A10023_002 2346 non-null int64 65 SE_A10023_003 2346 non-null int64 66 SE_A10020_001 2346 non-null int64 67 SE_A10020_002 2346 non-null int64 68 SE_A10020_003 2346 non-null int64 69 SE_A10020_004 2346 non-null int64 70 SE_A10020_005 2346 non-null int64 71 SE_A10020_006 2346 non-null int64 72 SE_A10020_007 2346 non-null int64 73 SE_A10020_008 2346 non-null int64 74 SE_A10020_009 2346 non-null int64 75 SE_A10020_010 2346 non-null int64 76 SE_A10021_001 2346 non-null int64 77 SE_A10021_002 2346 non-null int64 78 SE_A10021_003 2346 non-null int64 79 SE_A10021_004 2346 non-null int64 80 SE_A10021_005 2346 non-null int64 81 SE_A10026_001 2346 non-null int64 82 SE_A10026_002 2346 non-null int64 83 SE_A10026_003 2346 non-null int64 84 SE_A10026_004 2346 non-null int64 85 SE_A10026_005 2346 non-null int64 86 SE_A10026_006 2346 non-null int64 87 SE_A10026_007 2346 non-null int64 88 SE_A10026_008 2346 non-null int64 89 SE_A10026_009 2346 non-null int64 90 SE_A10026_010 2346 non-null int64 91 SE_A10026_011 2346 non-null int64 92 SE_A10026_012 2346 non-null int64 93 SE_A10026_013 2346 non-null int64 94 SE_A10026_014 2346 non-null int64 95 SE_A10026_015 2346 non-null int64 96 SE_A10026_016 2346 non-null int64 97 SE_A10026_017 2346 non-null int64 98 SE_A10026_018 2346 non-null int64 99 SE_A10026_019 2346 non-null int64 100 SE_A10026_020 2346 non-null int64 101 SE_A10026_021 2346 non-null int64 102 SE_A10026_022 2346 non-null int64 103 SE_A10026_023 2346 non-null int64 104 SE_A10001_001 2346 non-null int64 105 SE_A10032_001 2346 non-null int64 106 SE_A10032_002 2346 non-null int64 107 SE_A10032_003 2346 non-null int64 108 SE_A10032_004 2346 non-null int64 109 SE_A10032_005 2346 non-null int64 110 SE_A10032_006 2346 non-null int64 111 SE_A10032_007 2346 non-null int64 112 SE_A10032_008 2346 non-null int64 113 SE_A10032_009 2346 non-null int64 114 SE_A10032_010 2346 non-null int64 115 SE_A10032_011 2346 non-null int64 116 SE_A10032_012 2346 non-null int64 117 SE_A10053B_001 2346 non-null int64 118 SE_A10053B_002 2346 non-null int64 119 SE_A10053B_003 2346 non-null int64 120 SE_A10053B_004 2346 non-null int64 121 SE_A10053B_005 2346 non-null int64 122 SE_A10053B_006 2346 non-null int64 123 SE_A10053B_007 2346 non-null int64 124 SE_A10053B_008 2346 non-null int64 125 SE_A10053B_009 2346 non-null int64 126 SE_A10053B_010 2346 non-null int64 127 SE_A10053B_011 2346 non-null int64 128 SE_A10028_001 2346 non-null int64 129 SE_A10028_002 2346 non-null int64 130 SE_A10028_003 2346 non-null int64 131 SE_A10028_004 2346 non-null int64 132 SE_A10028_005 2346 non-null int64 133 SE_A10028_006 2346 non-null int64 134 SE_A10027_001 2346 non-null int64 135 SE_A10027_002 2346 non-null int64 136 SE_A10027_003 2346 non-null int64 137 SE_A10027_004 2346 non-null int64 138 SE_A10027_005 2346 non-null int64 139 SE_A10027_006 2346 non-null int64 140 SE_A10027_007 2346 non-null int64 141 SE_A10027_008 2346 non-null int64 142 SE_A10027_009 2346 non-null int64 143 SE_A10027_010 2346 non-null int64 144 SE_A10027_011 2346 non-null int64 145 SE_A10027_012 2346 non-null int64 146 SE_A10027_013 2346 non-null int64 147 SE_A10027_014 2346 non-null int64 148 SE_A10027_015 2346 non-null int64 149 SE_A10027_016 2346 non-null int64 150 SE_A10027_017 2346 non-null int64 151 SE_A10030_001 2346 non-null int64 152 SE_A10030_002 2346 non-null int64 153 SE_A10030_003 2346 non-null int64 154 SE_A10030_004 2346 non-null int64 155 SE_A10030_005 2346 non-null int64 156 SE_A10030_006 2346 non-null int64 157 SE_A10030_007 2346 non-null int64 158 ACS18_5yr_B25001001 2346 non-null int64 159 ACS18_5yr_B25001001s 2346 non-null float64 dtypes: float64(44), int64(111), object(5) memory usage: 2.9+ MB
# Change FIPS, State, and County to include leading zeros as string
df = pd.read_csv(
'housingunits.csv',
dtype=
{
'Geo_FIPS':str,
'Geo_STATE':str,
'Geo_COUNTY': str
}
)
# Confirm if data is changed
df.head(10)
| Geo_FIPS | Geo_GEOID | Geo_NAME | Geo_QName | Geo_STUSAB | Geo_SUMLEV | Geo_GEOCOMP | Geo_FILEID | Geo_LOGRECNO | Geo_US | Geo_REGION | Geo_DIVISION | Geo_STATECE | Geo_STATE | Geo_COUNTY | Geo_COUSUB | Geo_PLACE | Geo_PLACESE | Geo_TRACT | Geo_BLKGRP | Geo_CONCIT | Geo_AIANHH | Geo_AIANHHFP | Geo_AIHHTLI | Geo_AITSCE | Geo_AITS | Geo_ANRC | Geo_CBSA | Geo_CSA | Geo_METDIV | Geo_MACC | Geo_MEMI | Geo_NECTA | Geo_CNECTA | Geo_NECTADIV | Geo_UA | Geo_UACP | Geo_CDCURR | Geo_SLDU | Geo_SLDL | Geo_VTD | Geo_ZCTA3 | Geo_ZCTA5 | Geo_SUBMCD | Geo_SDELM | Geo_SDSEC | Geo_SDUNI | Geo_UR | Geo_PCI | Geo_TAZ | Geo_UGA | Geo_BTTR | Geo_BTBG | Geo_PUMA5 | Geo_PUMA1 | SE_A10024_001 | SE_A10024_002 | SE_A10024_003 | SE_A10024_004 | SE_A10024_005 | SE_A10024_006 | SE_A10024_007 | SE_A10024_008 | SE_A10023_001 | SE_A10023_002 | SE_A10023_003 | SE_A10020_001 | SE_A10020_002 | SE_A10020_003 | SE_A10020_004 | SE_A10020_005 | SE_A10020_006 | SE_A10020_007 | SE_A10020_008 | SE_A10020_009 | SE_A10020_010 | SE_A10021_001 | SE_A10021_002 | SE_A10021_003 | SE_A10021_004 | SE_A10021_005 | SE_A10026_001 | SE_A10026_002 | SE_A10026_003 | SE_A10026_004 | SE_A10026_005 | SE_A10026_006 | SE_A10026_007 | SE_A10026_008 | SE_A10026_009 | SE_A10026_010 | SE_A10026_011 | SE_A10026_012 | SE_A10026_013 | SE_A10026_014 | SE_A10026_015 | SE_A10026_016 | SE_A10026_017 | SE_A10026_018 | SE_A10026_019 | SE_A10026_020 | SE_A10026_021 | SE_A10026_022 | SE_A10026_023 | SE_A10001_001 | SE_A10032_001 | SE_A10032_002 | SE_A10032_003 | SE_A10032_004 | SE_A10032_005 | SE_A10032_006 | SE_A10032_007 | SE_A10032_008 | SE_A10032_009 | SE_A10032_010 | SE_A10032_011 | SE_A10032_012 | SE_A10053B_001 | SE_A10053B_002 | SE_A10053B_003 | SE_A10053B_004 | SE_A10053B_005 | SE_A10053B_006 | SE_A10053B_007 | SE_A10053B_008 | SE_A10053B_009 | SE_A10053B_010 | SE_A10053B_011 | SE_A10028_001 | SE_A10028_002 | SE_A10028_003 | SE_A10028_004 | SE_A10028_005 | SE_A10028_006 | SE_A10027_001 | SE_A10027_002 | SE_A10027_003 | SE_A10027_004 | SE_A10027_005 | SE_A10027_006 | SE_A10027_007 | SE_A10027_008 | SE_A10027_009 | SE_A10027_010 | SE_A10027_011 | SE_A10027_012 | SE_A10027_013 | SE_A10027_014 | SE_A10027_015 | SE_A10027_016 | SE_A10027_017 | SE_A10030_001 | SE_A10030_002 | SE_A10030_003 | SE_A10030_004 | SE_A10030_005 | SE_A10030_006 | SE_A10030_007 | ACS18_5yr_B25001001 | ACS18_5yr_B25001001s | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 06037101110 | 14000US06037101110 | Census Tract 1011.10 | Census Tract 1011.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3870 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 101110 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1596 | 518 | 399 | 286 | 237 | 113 | 43 | 0 | 1596 | 389 | 1207 | 1596 | 37 | 168 | 322 | 356 | 199 | 92 | 243 | 159 | 20 | 1596 | 255 | 336 | 609 | 396 | 1596 | 234 | 0 | 0 | 234 | 249 | 8 | 10 | 231 | 220 | 40 | 6 | 174 | 190 | 24 | 47 | 119 | 604 | 249 | 193 | 162 | 25 | 74 | 1743 | 1743 | 1175 | 1132 | 43 | 75 | 144 | 78 | 142 | 78 | 0 | 29 | 22 | 829 | 362 | 8 | 67 | 114 | 57 | 121 | 78 | 0 | 0 | 22 | 1596 | 934 | 580 | 54 | 8 | 20 | 1596 | 0 | 0 | 19 | 59 | 36 | 0 | 30 | 37 | 77 | 25 | 230 | 445 | 259 | 173 | 132 | 74 | 1596 | 123 | 603 | 501 | 277 | 67 | 25 | 1743 | 26.666670 |
| 1 | 06037101122 | 14000US06037101122 | Census Tract 1011.22 | Census Tract 1011.22, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3871 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 101122 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1256 | 279 | 494 | 212 | 230 | 8 | 33 | 0 | 1256 | 74 | 1182 | 1256 | 6 | 127 | 91 | 303 | 151 | 225 | 223 | 116 | 14 | 1256 | 103 | 288 | 464 | 401 | 1256 | 51 | 0 | 0 | 51 | 92 | 27 | 8 | 57 | 70 | 15 | 0 | 55 | 225 | 15 | 41 | 169 | 776 | 355 | 227 | 194 | 19 | 23 | 1391 | 1391 | 1391 | 1391 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 230 | 230 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1256 | 786 | 408 | 49 | 0 | 13 | 1256 | 0 | 7 | 15 | 14 | 75 | 6 | 15 | 14 | 39 | 18 | 150 | 125 | 265 | 236 | 254 | 23 | 1256 | 7 | 349 | 548 | 199 | 136 | 17 | 1391 | 12.121210 |
| 2 | 06037101210 | 14000US06037101210 | Census Tract 1012.10 | Census Tract 1012.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3872 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 101210 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 2321 | 686 | 633 | 532 | 313 | 91 | 66 | 0 | 2321 | 702 | 1619 | 2321 | 29 | 433 | 496 | 549 | 232 | 300 | 160 | 107 | 15 | 2321 | 405 | 595 | 808 | 513 | 2321 | 646 | 16 | 36 | 594 | 421 | 0 | 0 | 421 | 376 | 15 | 95 | 266 | 229 | 30 | 32 | 167 | 460 | 247 | 115 | 98 | 114 | 75 | 2402 | 2402 | 463 | 370 | 93 | 70 | 46 | 398 | 799 | 551 | 75 | 0 | 0 | 1984 | 193 | 32 | 57 | 33 | 341 | 719 | 534 | 75 | 0 | 0 | 2321 | 884 | 1152 | 182 | 30 | 73 | 2321 | 18 | 13 | 32 | 29 | 27 | 17 | 65 | 59 | 59 | 98 | 994 | 477 | 185 | 117 | 56 | 75 | 2321 | 287 | 1137 | 700 | 189 | 8 | 0 | 2402 | 33.939390 |
| 3 | 06037101220 | 14000US06037101220 | Census Tract 1012.20 | Census Tract 1012.20, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3873 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 101220 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1294 | 354 | 420 | 163 | 217 | 80 | 60 | 0 | 1294 | 295 | 999 | 1294 | 9 | 142 | 309 | 226 | 155 | 137 | 195 | 83 | 38 | 1294 | 229 | 315 | 495 | 255 | 1294 | 301 | 0 | 9 | 292 | 211 | 9 | 8 | 194 | 301 | 17 | 27 | 257 | 128 | 34 | 57 | 37 | 325 | 180 | 102 | 43 | 28 | 0 | 1328 | 1328 | 729 | 626 | 103 | 14 | 72 | 174 | 175 | 127 | 37 | 0 | 0 | 823 | 222 | 58 | 14 | 72 | 145 | 148 | 127 | 37 | 0 | 0 | 1294 | 596 | 546 | 107 | 21 | 24 | 1294 | 0 | 0 | 42 | 25 | 13 | 49 | 62 | 36 | 48 | 66 | 416 | 277 | 154 | 69 | 37 | 0 | 1294 | 113 | 544 | 419 | 136 | 29 | 53 | 1328 | 26.060610 |
| 4 | 06037101300 | 14000US06037101300 | Census Tract 1013 | Census Tract 1013, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3874 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 101300 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1435 | 270 | 488 | 236 | 326 | 43 | 72 | 0 | 1435 | 61 | 1374 | 1435 | 10 | 87 | 153 | 377 | 199 | 266 | 157 | 99 | 87 | 1435 | 52 | 380 | 465 | 538 | 1435 | 105 | 7 | 6 | 92 | 88 | 31 | 14 | 43 | 184 | 14 | 15 | 155 | 167 | 51 | 24 | 92 | 832 | 489 | 138 | 205 | 53 | 6 | 1584 | 1584 | 1534 | 1443 | 91 | 0 | 7 | 0 | 36 | 0 | 0 | 7 | 0 | 167 | 159 | 0 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 1435 | 920 | 481 | 11 | 0 | 23 | 1435 | 6 | 7 | 22 | 57 | 29 | 60 | 51 | 43 | 70 | 48 | 96 | 99 | 202 | 272 | 367 | 6 | 1435 | 66 | 291 | 575 | 261 | 211 | 31 | 1584 | 26.060610 |
| 5 | 06037101400 | 14000US06037101400 | Census Tract 1014 | Census Tract 1014, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3875 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 101400 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1473 | 426 | 432 | 315 | 182 | 84 | 25 | 9 | 1473 | 240 | 1233 | 1473 | 6 | 178 | 141 | 398 | 142 | 216 | 225 | 90 | 77 | 1473 | 147 | 205 | 529 | 592 | 1473 | 161 | 9 | 0 | 152 | 279 | 29 | 76 | 174 | 71 | 0 | 22 | 49 | 212 | 69 | 10 | 133 | 677 | 224 | 251 | 202 | 9 | 64 | 1614 | 1614 | 1392 | 1344 | 48 | 0 | 10 | 69 | 31 | 99 | 0 | 13 | 0 | 424 | 222 | 9 | 0 | 10 | 40 | 31 | 99 | 0 | 13 | 0 | 1473 | 898 | 536 | 19 | 9 | 11 | 1473 | 0 | 9 | 11 | 30 | 169 | 19 | 35 | 17 | 49 | 30 | 259 | 152 | 144 | 230 | 255 | 64 | 1473 | 121 | 368 | 682 | 204 | 83 | 15 | 1614 | 24.242420 |
| 6 | 06037102103 | 14000US06037102103 | Census Tract 1021.03 | Census Tract 1021.03, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3876 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 102103 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 696 | 162 | 251 | 149 | 97 | 37 | 0 | 0 | 696 | 160 | 536 | 696 | 0 | 78 | 130 | 156 | 105 | 47 | 91 | 56 | 33 | 696 | 35 | 180 | 201 | 280 | 696 | 65 | 0 | 0 | 65 | 59 | 0 | 12 | 47 | 57 | 17 | 10 | 30 | 134 | 24 | 9 | 101 | 351 | 120 | 116 | 115 | 7 | 23 | 726 | 726 | 577 | 577 | 0 | 0 | 23 | 0 | 9 | 29 | 88 | 0 | 0 | 239 | 99 | 0 | 0 | 23 | 0 | 9 | 29 | 79 | 0 | 0 | 696 | 440 | 231 | 0 | 21 | 4 | 696 | 0 | 4 | 0 | 0 | 18 | 12 | 19 | 14 | 9 | 14 | 105 | 45 | 182 | 99 | 152 | 23 | 696 | 8 | 241 | 266 | 131 | 50 | 0 | 726 | 7.878788 |
| 7 | 06037102104 | 14000US06037102104 | Census Tract 1021.04 | Census Tract 1021.04, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3877 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 102104 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1270 | 261 | 512 | 221 | 217 | 30 | 29 | 0 | 1270 | 214 | 1056 | 1270 | 19 | 151 | 231 | 142 | 172 | 229 | 163 | 101 | 62 | 1270 | 58 | 271 | 472 | 469 | 1270 | 110 | 0 | 0 | 110 | 87 | 9 | 17 | 61 | 296 | 9 | 0 | 287 | 174 | 57 | 23 | 94 | 578 | 203 | 176 | 199 | 0 | 25 | 1345 | 1345 | 1066 | 586 | 480 | 0 | 91 | 44 | 65 | 0 | 73 | 6 | 0 | 375 | 91 | 150 | 0 | 11 | 31 | 65 | 0 | 27 | 0 | 0 | 1270 | 854 | 386 | 30 | 0 | 0 | 1270 | 0 | 0 | 22 | 9 | 29 | 8 | 59 | 53 | 42 | 13 | 123 | 238 | 175 | 203 | 271 | 25 | 1270 | 83 | 410 | 505 | 117 | 113 | 42 | 1345 | 24.242420 |
| 8 | 06037102105 | 14000US06037102105 | Census Tract 1021.05 | Census Tract 1021.05, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3878 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 102105 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 563 | 111 | 138 | 117 | 83 | 68 | 16 | 30 | 563 | 346 | 217 | 563 | 0 | 29 | 182 | 113 | 76 | 75 | 63 | 25 | 0 | 563 | 93 | 163 | 206 | 101 | 563 | 43 | 0 | 6 | 37 | 112 | 0 | 0 | 112 | 77 | 10 | 0 | 67 | 111 | 21 | 24 | 66 | 214 | 82 | 71 | 61 | 0 | 6 | 589 | 589 | 388 | 332 | 56 | 21 | 26 | 28 | 47 | 50 | 24 | 0 | 5 | 293 | 74 | 42 | 16 | 21 | 28 | 47 | 36 | 24 | 0 | 5 | 563 | 221 | 284 | 53 | 5 | 0 | 563 | 0 | 0 | 0 | 6 | 9 | 8 | 9 | 18 | 9 | 15 | 176 | 136 | 92 | 69 | 10 | 6 | 563 | 8 | 203 | 213 | 72 | 32 | 35 | 589 | 9.696970 |
| 9 | 06037102107 | 14000US06037102107 | Census Tract 1021.07 | Census Tract 1021.07, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3879 | NaN | NaN | NaN | NaN | 06 | 037 | NaN | NaN | NaN | 102107 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 1305 | 149 | 423 | 294 | 286 | 99 | 44 | 10 | 1305 | 349 | 956 | 1305 | 0 | 63 | 252 | 360 | 191 | 122 | 186 | 91 | 40 | 1305 | 128 | 271 | 512 | 394 | 1305 | 51 | 0 | 0 | 51 | 126 | 0 | 0 | 126 | 84 | 35 | 29 | 20 | 222 | 28 | 61 | 133 | 787 | 478 | 174 | 135 | 0 | 35 | 1352 | 1352 | 1246 | 1101 | 145 | 0 | 7 | 56 | 23 | 13 | 7 | 0 | 0 | 335 | 192 | 44 | 0 | 0 | 56 | 23 | 13 | 7 | 0 | 0 | 1305 | 829 | 435 | 10 | 19 | 12 | 1305 | 0 | 0 | 47 | 0 | 15 | 24 | 70 | 21 | 98 | 58 | 175 | 140 | 179 | 122 | 321 | 35 | 1305 | 51 | 218 | 570 | 285 | 139 | 42 | 1352 | 20.606060 |
# Find all null columns to clean data
df.columns[df.isna().all()].tolist()
['Geo_US', 'Geo_REGION', 'Geo_DIVISION', 'Geo_STATECE', 'Geo_COUSUB', 'Geo_PLACE', 'Geo_PLACESE', 'Geo_BLKGRP', 'Geo_CONCIT', 'Geo_AIANHH', 'Geo_AIANHHFP', 'Geo_AIHHTLI', 'Geo_AITSCE', 'Geo_AITS', 'Geo_ANRC', 'Geo_CBSA', 'Geo_CSA', 'Geo_METDIV', 'Geo_MACC', 'Geo_MEMI', 'Geo_NECTA', 'Geo_CNECTA', 'Geo_NECTADIV', 'Geo_UA', 'Geo_UACP', 'Geo_CDCURR', 'Geo_SLDU', 'Geo_SLDL', 'Geo_VTD', 'Geo_ZCTA3', 'Geo_ZCTA5', 'Geo_SUBMCD', 'Geo_SDELM', 'Geo_SDSEC', 'Geo_SDUNI', 'Geo_UR', 'Geo_PCI', 'Geo_TAZ', 'Geo_UGA', 'Geo_BTTR', 'Geo_BTBG', 'Geo_PUMA5', 'Geo_PUMA1']
# Drop all null columns to cut data
df = df.dropna(axis=1,how="all")
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 2346 entries, 0 to 2345 Columns: 117 entries, Geo_FIPS to ACS18_5yr_B25001001s dtypes: float64(1), int64(108), object(8) memory usage: 2.1+ MB
# Double-check data; Still a lot of columns because pulled multivariables
df.head(10)
| Geo_FIPS | Geo_GEOID | Geo_NAME | Geo_QName | Geo_STUSAB | Geo_SUMLEV | Geo_GEOCOMP | Geo_FILEID | Geo_LOGRECNO | Geo_STATE | Geo_COUNTY | Geo_TRACT | SE_A10024_001 | SE_A10024_002 | SE_A10024_003 | SE_A10024_004 | SE_A10024_005 | SE_A10024_006 | SE_A10024_007 | SE_A10024_008 | SE_A10023_001 | SE_A10023_002 | SE_A10023_003 | SE_A10020_001 | SE_A10020_002 | SE_A10020_003 | SE_A10020_004 | SE_A10020_005 | SE_A10020_006 | SE_A10020_007 | SE_A10020_008 | SE_A10020_009 | SE_A10020_010 | SE_A10021_001 | SE_A10021_002 | SE_A10021_003 | SE_A10021_004 | SE_A10021_005 | SE_A10026_001 | SE_A10026_002 | SE_A10026_003 | SE_A10026_004 | SE_A10026_005 | SE_A10026_006 | SE_A10026_007 | SE_A10026_008 | SE_A10026_009 | SE_A10026_010 | SE_A10026_011 | SE_A10026_012 | SE_A10026_013 | SE_A10026_014 | SE_A10026_015 | SE_A10026_016 | SE_A10026_017 | SE_A10026_018 | SE_A10026_019 | SE_A10026_020 | SE_A10026_021 | SE_A10026_022 | SE_A10026_023 | SE_A10001_001 | SE_A10032_001 | SE_A10032_002 | SE_A10032_003 | SE_A10032_004 | SE_A10032_005 | SE_A10032_006 | SE_A10032_007 | SE_A10032_008 | SE_A10032_009 | SE_A10032_010 | SE_A10032_011 | SE_A10032_012 | SE_A10053B_001 | SE_A10053B_002 | SE_A10053B_003 | SE_A10053B_004 | SE_A10053B_005 | SE_A10053B_006 | SE_A10053B_007 | SE_A10053B_008 | SE_A10053B_009 | SE_A10053B_010 | SE_A10053B_011 | SE_A10028_001 | SE_A10028_002 | SE_A10028_003 | SE_A10028_004 | SE_A10028_005 | SE_A10028_006 | SE_A10027_001 | SE_A10027_002 | SE_A10027_003 | SE_A10027_004 | SE_A10027_005 | SE_A10027_006 | SE_A10027_007 | SE_A10027_008 | SE_A10027_009 | SE_A10027_010 | SE_A10027_011 | SE_A10027_012 | SE_A10027_013 | SE_A10027_014 | SE_A10027_015 | SE_A10027_016 | SE_A10027_017 | SE_A10030_001 | SE_A10030_002 | SE_A10030_003 | SE_A10030_004 | SE_A10030_005 | SE_A10030_006 | SE_A10030_007 | ACS18_5yr_B25001001 | ACS18_5yr_B25001001s | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 06037101110 | 14000US06037101110 | Census Tract 1011.10 | Census Tract 1011.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3870 | 06 | 037 | 101110 | 1596 | 518 | 399 | 286 | 237 | 113 | 43 | 0 | 1596 | 389 | 1207 | 1596 | 37 | 168 | 322 | 356 | 199 | 92 | 243 | 159 | 20 | 1596 | 255 | 336 | 609 | 396 | 1596 | 234 | 0 | 0 | 234 | 249 | 8 | 10 | 231 | 220 | 40 | 6 | 174 | 190 | 24 | 47 | 119 | 604 | 249 | 193 | 162 | 25 | 74 | 1743 | 1743 | 1175 | 1132 | 43 | 75 | 144 | 78 | 142 | 78 | 0 | 29 | 22 | 829 | 362 | 8 | 67 | 114 | 57 | 121 | 78 | 0 | 0 | 22 | 1596 | 934 | 580 | 54 | 8 | 20 | 1596 | 0 | 0 | 19 | 59 | 36 | 0 | 30 | 37 | 77 | 25 | 230 | 445 | 259 | 173 | 132 | 74 | 1596 | 123 | 603 | 501 | 277 | 67 | 25 | 1743 | 26.666670 |
| 1 | 06037101122 | 14000US06037101122 | Census Tract 1011.22 | Census Tract 1011.22, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3871 | 06 | 037 | 101122 | 1256 | 279 | 494 | 212 | 230 | 8 | 33 | 0 | 1256 | 74 | 1182 | 1256 | 6 | 127 | 91 | 303 | 151 | 225 | 223 | 116 | 14 | 1256 | 103 | 288 | 464 | 401 | 1256 | 51 | 0 | 0 | 51 | 92 | 27 | 8 | 57 | 70 | 15 | 0 | 55 | 225 | 15 | 41 | 169 | 776 | 355 | 227 | 194 | 19 | 23 | 1391 | 1391 | 1391 | 1391 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 230 | 230 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1256 | 786 | 408 | 49 | 0 | 13 | 1256 | 0 | 7 | 15 | 14 | 75 | 6 | 15 | 14 | 39 | 18 | 150 | 125 | 265 | 236 | 254 | 23 | 1256 | 7 | 349 | 548 | 199 | 136 | 17 | 1391 | 12.121210 |
| 2 | 06037101210 | 14000US06037101210 | Census Tract 1012.10 | Census Tract 1012.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3872 | 06 | 037 | 101210 | 2321 | 686 | 633 | 532 | 313 | 91 | 66 | 0 | 2321 | 702 | 1619 | 2321 | 29 | 433 | 496 | 549 | 232 | 300 | 160 | 107 | 15 | 2321 | 405 | 595 | 808 | 513 | 2321 | 646 | 16 | 36 | 594 | 421 | 0 | 0 | 421 | 376 | 15 | 95 | 266 | 229 | 30 | 32 | 167 | 460 | 247 | 115 | 98 | 114 | 75 | 2402 | 2402 | 463 | 370 | 93 | 70 | 46 | 398 | 799 | 551 | 75 | 0 | 0 | 1984 | 193 | 32 | 57 | 33 | 341 | 719 | 534 | 75 | 0 | 0 | 2321 | 884 | 1152 | 182 | 30 | 73 | 2321 | 18 | 13 | 32 | 29 | 27 | 17 | 65 | 59 | 59 | 98 | 994 | 477 | 185 | 117 | 56 | 75 | 2321 | 287 | 1137 | 700 | 189 | 8 | 0 | 2402 | 33.939390 |
| 3 | 06037101220 | 14000US06037101220 | Census Tract 1012.20 | Census Tract 1012.20, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3873 | 06 | 037 | 101220 | 1294 | 354 | 420 | 163 | 217 | 80 | 60 | 0 | 1294 | 295 | 999 | 1294 | 9 | 142 | 309 | 226 | 155 | 137 | 195 | 83 | 38 | 1294 | 229 | 315 | 495 | 255 | 1294 | 301 | 0 | 9 | 292 | 211 | 9 | 8 | 194 | 301 | 17 | 27 | 257 | 128 | 34 | 57 | 37 | 325 | 180 | 102 | 43 | 28 | 0 | 1328 | 1328 | 729 | 626 | 103 | 14 | 72 | 174 | 175 | 127 | 37 | 0 | 0 | 823 | 222 | 58 | 14 | 72 | 145 | 148 | 127 | 37 | 0 | 0 | 1294 | 596 | 546 | 107 | 21 | 24 | 1294 | 0 | 0 | 42 | 25 | 13 | 49 | 62 | 36 | 48 | 66 | 416 | 277 | 154 | 69 | 37 | 0 | 1294 | 113 | 544 | 419 | 136 | 29 | 53 | 1328 | 26.060610 |
| 4 | 06037101300 | 14000US06037101300 | Census Tract 1013 | Census Tract 1013, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3874 | 06 | 037 | 101300 | 1435 | 270 | 488 | 236 | 326 | 43 | 72 | 0 | 1435 | 61 | 1374 | 1435 | 10 | 87 | 153 | 377 | 199 | 266 | 157 | 99 | 87 | 1435 | 52 | 380 | 465 | 538 | 1435 | 105 | 7 | 6 | 92 | 88 | 31 | 14 | 43 | 184 | 14 | 15 | 155 | 167 | 51 | 24 | 92 | 832 | 489 | 138 | 205 | 53 | 6 | 1584 | 1584 | 1534 | 1443 | 91 | 0 | 7 | 0 | 36 | 0 | 0 | 7 | 0 | 167 | 159 | 0 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 1435 | 920 | 481 | 11 | 0 | 23 | 1435 | 6 | 7 | 22 | 57 | 29 | 60 | 51 | 43 | 70 | 48 | 96 | 99 | 202 | 272 | 367 | 6 | 1435 | 66 | 291 | 575 | 261 | 211 | 31 | 1584 | 26.060610 |
| 5 | 06037101400 | 14000US06037101400 | Census Tract 1014 | Census Tract 1014, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3875 | 06 | 037 | 101400 | 1473 | 426 | 432 | 315 | 182 | 84 | 25 | 9 | 1473 | 240 | 1233 | 1473 | 6 | 178 | 141 | 398 | 142 | 216 | 225 | 90 | 77 | 1473 | 147 | 205 | 529 | 592 | 1473 | 161 | 9 | 0 | 152 | 279 | 29 | 76 | 174 | 71 | 0 | 22 | 49 | 212 | 69 | 10 | 133 | 677 | 224 | 251 | 202 | 9 | 64 | 1614 | 1614 | 1392 | 1344 | 48 | 0 | 10 | 69 | 31 | 99 | 0 | 13 | 0 | 424 | 222 | 9 | 0 | 10 | 40 | 31 | 99 | 0 | 13 | 0 | 1473 | 898 | 536 | 19 | 9 | 11 | 1473 | 0 | 9 | 11 | 30 | 169 | 19 | 35 | 17 | 49 | 30 | 259 | 152 | 144 | 230 | 255 | 64 | 1473 | 121 | 368 | 682 | 204 | 83 | 15 | 1614 | 24.242420 |
| 6 | 06037102103 | 14000US06037102103 | Census Tract 1021.03 | Census Tract 1021.03, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3876 | 06 | 037 | 102103 | 696 | 162 | 251 | 149 | 97 | 37 | 0 | 0 | 696 | 160 | 536 | 696 | 0 | 78 | 130 | 156 | 105 | 47 | 91 | 56 | 33 | 696 | 35 | 180 | 201 | 280 | 696 | 65 | 0 | 0 | 65 | 59 | 0 | 12 | 47 | 57 | 17 | 10 | 30 | 134 | 24 | 9 | 101 | 351 | 120 | 116 | 115 | 7 | 23 | 726 | 726 | 577 | 577 | 0 | 0 | 23 | 0 | 9 | 29 | 88 | 0 | 0 | 239 | 99 | 0 | 0 | 23 | 0 | 9 | 29 | 79 | 0 | 0 | 696 | 440 | 231 | 0 | 21 | 4 | 696 | 0 | 4 | 0 | 0 | 18 | 12 | 19 | 14 | 9 | 14 | 105 | 45 | 182 | 99 | 152 | 23 | 696 | 8 | 241 | 266 | 131 | 50 | 0 | 726 | 7.878788 |
| 7 | 06037102104 | 14000US06037102104 | Census Tract 1021.04 | Census Tract 1021.04, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3877 | 06 | 037 | 102104 | 1270 | 261 | 512 | 221 | 217 | 30 | 29 | 0 | 1270 | 214 | 1056 | 1270 | 19 | 151 | 231 | 142 | 172 | 229 | 163 | 101 | 62 | 1270 | 58 | 271 | 472 | 469 | 1270 | 110 | 0 | 0 | 110 | 87 | 9 | 17 | 61 | 296 | 9 | 0 | 287 | 174 | 57 | 23 | 94 | 578 | 203 | 176 | 199 | 0 | 25 | 1345 | 1345 | 1066 | 586 | 480 | 0 | 91 | 44 | 65 | 0 | 73 | 6 | 0 | 375 | 91 | 150 | 0 | 11 | 31 | 65 | 0 | 27 | 0 | 0 | 1270 | 854 | 386 | 30 | 0 | 0 | 1270 | 0 | 0 | 22 | 9 | 29 | 8 | 59 | 53 | 42 | 13 | 123 | 238 | 175 | 203 | 271 | 25 | 1270 | 83 | 410 | 505 | 117 | 113 | 42 | 1345 | 24.242420 |
| 8 | 06037102105 | 14000US06037102105 | Census Tract 1021.05 | Census Tract 1021.05, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3878 | 06 | 037 | 102105 | 563 | 111 | 138 | 117 | 83 | 68 | 16 | 30 | 563 | 346 | 217 | 563 | 0 | 29 | 182 | 113 | 76 | 75 | 63 | 25 | 0 | 563 | 93 | 163 | 206 | 101 | 563 | 43 | 0 | 6 | 37 | 112 | 0 | 0 | 112 | 77 | 10 | 0 | 67 | 111 | 21 | 24 | 66 | 214 | 82 | 71 | 61 | 0 | 6 | 589 | 589 | 388 | 332 | 56 | 21 | 26 | 28 | 47 | 50 | 24 | 0 | 5 | 293 | 74 | 42 | 16 | 21 | 28 | 47 | 36 | 24 | 0 | 5 | 563 | 221 | 284 | 53 | 5 | 0 | 563 | 0 | 0 | 0 | 6 | 9 | 8 | 9 | 18 | 9 | 15 | 176 | 136 | 92 | 69 | 10 | 6 | 563 | 8 | 203 | 213 | 72 | 32 | 35 | 589 | 9.696970 |
| 9 | 06037102107 | 14000US06037102107 | Census Tract 1021.07 | Census Tract 1021.07, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3879 | 06 | 037 | 102107 | 1305 | 149 | 423 | 294 | 286 | 99 | 44 | 10 | 1305 | 349 | 956 | 1305 | 0 | 63 | 252 | 360 | 191 | 122 | 186 | 91 | 40 | 1305 | 128 | 271 | 512 | 394 | 1305 | 51 | 0 | 0 | 51 | 126 | 0 | 0 | 126 | 84 | 35 | 29 | 20 | 222 | 28 | 61 | 133 | 787 | 478 | 174 | 135 | 0 | 35 | 1352 | 1352 | 1246 | 1101 | 145 | 0 | 7 | 56 | 23 | 13 | 7 | 0 | 0 | 335 | 192 | 44 | 0 | 0 | 56 | 23 | 13 | 7 | 0 | 0 | 1305 | 829 | 435 | 10 | 19 | 12 | 1305 | 0 | 0 | 47 | 0 | 15 | 24 | 70 | 21 | 98 | 58 | 175 | 140 | 179 | 122 | 321 | 35 | 1305 | 51 | 218 | 570 | 285 | 139 | 42 | 1352 | 20.606060 |
columns = list(df) # this is the same as df.columns.to_list()
columns
['Geo_FIPS', 'Geo_GEOID', 'Geo_NAME', 'Geo_QName', 'Geo_STUSAB', 'Geo_SUMLEV', 'Geo_GEOCOMP', 'Geo_FILEID', 'Geo_LOGRECNO', 'Geo_STATE', 'Geo_COUNTY', 'Geo_TRACT', 'SE_A10024_001', 'SE_A10024_002', 'SE_A10024_003', 'SE_A10024_004', 'SE_A10024_005', 'SE_A10024_006', 'SE_A10024_007', 'SE_A10024_008', 'SE_A10023_001', 'SE_A10023_002', 'SE_A10023_003', 'SE_A10020_001', 'SE_A10020_002', 'SE_A10020_003', 'SE_A10020_004', 'SE_A10020_005', 'SE_A10020_006', 'SE_A10020_007', 'SE_A10020_008', 'SE_A10020_009', 'SE_A10020_010', 'SE_A10021_001', 'SE_A10021_002', 'SE_A10021_003', 'SE_A10021_004', 'SE_A10021_005', 'SE_A10026_001', 'SE_A10026_002', 'SE_A10026_003', 'SE_A10026_004', 'SE_A10026_005', 'SE_A10026_006', 'SE_A10026_007', 'SE_A10026_008', 'SE_A10026_009', 'SE_A10026_010', 'SE_A10026_011', 'SE_A10026_012', 'SE_A10026_013', 'SE_A10026_014', 'SE_A10026_015', 'SE_A10026_016', 'SE_A10026_017', 'SE_A10026_018', 'SE_A10026_019', 'SE_A10026_020', 'SE_A10026_021', 'SE_A10026_022', 'SE_A10026_023', 'SE_A10001_001', 'SE_A10032_001', 'SE_A10032_002', 'SE_A10032_003', 'SE_A10032_004', 'SE_A10032_005', 'SE_A10032_006', 'SE_A10032_007', 'SE_A10032_008', 'SE_A10032_009', 'SE_A10032_010', 'SE_A10032_011', 'SE_A10032_012', 'SE_A10053B_001', 'SE_A10053B_002', 'SE_A10053B_003', 'SE_A10053B_004', 'SE_A10053B_005', 'SE_A10053B_006', 'SE_A10053B_007', 'SE_A10053B_008', 'SE_A10053B_009', 'SE_A10053B_010', 'SE_A10053B_011', 'SE_A10028_001', 'SE_A10028_002', 'SE_A10028_003', 'SE_A10028_004', 'SE_A10028_005', 'SE_A10028_006', 'SE_A10027_001', 'SE_A10027_002', 'SE_A10027_003', 'SE_A10027_004', 'SE_A10027_005', 'SE_A10027_006', 'SE_A10027_007', 'SE_A10027_008', 'SE_A10027_009', 'SE_A10027_010', 'SE_A10027_011', 'SE_A10027_012', 'SE_A10027_013', 'SE_A10027_014', 'SE_A10027_015', 'SE_A10027_016', 'SE_A10027_017', 'SE_A10030_001', 'SE_A10030_002', 'SE_A10030_003', 'SE_A10030_004', 'SE_A10030_005', 'SE_A10030_006', 'SE_A10030_007', 'ACS18_5yr_B25001001', 'ACS18_5yr_B25001001s']
df.columns = ['FIPS',
'GEOID',
'Geo_NAME',
'Geo_QName',
'Geo_STUSAB',
'Geo_SUMLEV',
'Geo_GEOCOMP',
'Geo_FILEID',
'Geo_LOGRECNO',
'Geo_STATE',
'Geo_COUNTY',
'Geo_TRACT',
'OccupiedHousingUnits',
'1Household',
'2Household',
'3Household',
'4Household',
'5Household',
'6Household',
'7MoreHousehold',
'OccupiedHousingUnits',
'HispanicLatino',
'NotHispanicLatino',
'OccupiedHousingUnits',
'15to24YO',
'25to34YO',
'35to44YO',
'45to54YO',
'55to59YO',
'60to64YO',
'65to74YO',
'75to84YO',
'85MoreYO',
'OccupiedHousingUnits',
'LessHS',
'HSGrad',
'SomeCollege_or_Assoc',
'BachelorMore',
'OccupiedHousingUnits',
'Less20K',
'Less20percent',
'20to29percent',
'30PercentMore',
'20Kto34999',
'Less20percent',
'20to29percent',
'30PercentMore',
'35Kto49999',
'Less20percent',
'20to29percent',
'30PercentMore',
'50Kto74999',
'Less20percent',
'20to29percent',
'30PercentMore',
'75KMore',
'Less20percent',
'20to29percent',
'30PercentMore',
'Zero_or_NegIncome',
'NoCashRent',
'HousingUnits',
'HousingUnits',
'1Unit',
'1_Detached',
'1_Attached',
'2Units',
'3or4Units',
'5to9Units',
'10to19Units',
'20to49Units',
'50MoreUnits',
'MobileHome',
'Boat_RV_Van',
'RenterOccupiedHousingUnits',
'1_Detached',
'1_Attached',
'2Units',
'3or4Units',
'5to9Units',
'10to19Units',
'20to49Units',
'50MoreUnits',
'MobileHome',
'Boat_RV_Van',
'OccupiedHousingUnits',
'0.50orLess_perRM',
'0.51to1_perRM',
'1.01to1.5O_perRM',
'1.51to2_perRM',
'2.01orMore_perRM',
'OccupiedHousingUnits',
'Less100',
'100to199',
'200to299',
'300to399',
'400to499',
'500to599',
'600to699',
'700to799',
'800to899',
'900to999',
'1Kto1499',
'1_5Kto1999',
'2Kto2499',
'2_5Kto2999',
'3KMore',
'NoCashRent',
'OccupiedHousingUnits',
'NoVehic',
'1Vehic',
'2Vehic',
'3Vehic',
'4Vehic',
'5MoreVehic',
'TotalHousingUnits',
'StdErrorHousingUnits']
# Double-check data again for changes
df.head(10)
| FIPS | GEOID | Geo_NAME | Geo_QName | Geo_STUSAB | Geo_SUMLEV | Geo_GEOCOMP | Geo_FILEID | Geo_LOGRECNO | Geo_STATE | Geo_COUNTY | Geo_TRACT | OccupiedHousingUnits | 1Household | 2Household | 3Household | 4Household | 5Household | 6Household | 7MoreHousehold | OccupiedHousingUnits | HispanicLatino | NotHispanicLatino | OccupiedHousingUnits | 15to24YO | 25to34YO | 35to44YO | 45to54YO | 55to59YO | 60to64YO | 65to74YO | 75to84YO | 85MoreYO | OccupiedHousingUnits | LessHS | HSGrad | SomeCollege_or_Assoc | BachelorMore | OccupiedHousingUnits | Less20K | Less20percent | 20to29percent | 30PercentMore | 20Kto34999 | Less20percent | 20to29percent | 30PercentMore | 35Kto49999 | Less20percent | 20to29percent | 30PercentMore | 50Kto74999 | Less20percent | 20to29percent | 30PercentMore | 75KMore | Less20percent | 20to29percent | 30PercentMore | Zero_or_NegIncome | NoCashRent | HousingUnits | HousingUnits | 1Unit | 1_Detached | 1_Attached | 2Units | 3or4Units | 5to9Units | 10to19Units | 20to49Units | 50MoreUnits | MobileHome | Boat_RV_Van | RenterOccupiedHousingUnits | 1_Detached | 1_Attached | 2Units | 3or4Units | 5to9Units | 10to19Units | 20to49Units | 50MoreUnits | MobileHome | Boat_RV_Van | OccupiedHousingUnits | 0.50orLess_perRM | 0.51to1_perRM | 1.01to1.5O_perRM | 1.51to2_perRM | 2.01orMore_perRM | OccupiedHousingUnits | Less100 | 100to199 | 200to299 | 300to399 | 400to499 | 500to599 | 600to699 | 700to799 | 800to899 | 900to999 | 1Kto1499 | 1_5Kto1999 | 2Kto2499 | 2_5Kto2999 | 3KMore | NoCashRent | OccupiedHousingUnits | NoVehic | 1Vehic | 2Vehic | 3Vehic | 4Vehic | 5MoreVehic | TotalHousingUnits | StdErrorHousingUnits | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 06037101110 | 14000US06037101110 | Census Tract 1011.10 | Census Tract 1011.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3870 | 06 | 037 | 101110 | 1596 | 518 | 399 | 286 | 237 | 113 | 43 | 0 | 1596 | 389 | 1207 | 1596 | 37 | 168 | 322 | 356 | 199 | 92 | 243 | 159 | 20 | 1596 | 255 | 336 | 609 | 396 | 1596 | 234 | 0 | 0 | 234 | 249 | 8 | 10 | 231 | 220 | 40 | 6 | 174 | 190 | 24 | 47 | 119 | 604 | 249 | 193 | 162 | 25 | 74 | 1743 | 1743 | 1175 | 1132 | 43 | 75 | 144 | 78 | 142 | 78 | 0 | 29 | 22 | 829 | 362 | 8 | 67 | 114 | 57 | 121 | 78 | 0 | 0 | 22 | 1596 | 934 | 580 | 54 | 8 | 20 | 1596 | 0 | 0 | 19 | 59 | 36 | 0 | 30 | 37 | 77 | 25 | 230 | 445 | 259 | 173 | 132 | 74 | 1596 | 123 | 603 | 501 | 277 | 67 | 25 | 1743 | 26.666670 |
| 1 | 06037101122 | 14000US06037101122 | Census Tract 1011.22 | Census Tract 1011.22, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3871 | 06 | 037 | 101122 | 1256 | 279 | 494 | 212 | 230 | 8 | 33 | 0 | 1256 | 74 | 1182 | 1256 | 6 | 127 | 91 | 303 | 151 | 225 | 223 | 116 | 14 | 1256 | 103 | 288 | 464 | 401 | 1256 | 51 | 0 | 0 | 51 | 92 | 27 | 8 | 57 | 70 | 15 | 0 | 55 | 225 | 15 | 41 | 169 | 776 | 355 | 227 | 194 | 19 | 23 | 1391 | 1391 | 1391 | 1391 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 230 | 230 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1256 | 786 | 408 | 49 | 0 | 13 | 1256 | 0 | 7 | 15 | 14 | 75 | 6 | 15 | 14 | 39 | 18 | 150 | 125 | 265 | 236 | 254 | 23 | 1256 | 7 | 349 | 548 | 199 | 136 | 17 | 1391 | 12.121210 |
| 2 | 06037101210 | 14000US06037101210 | Census Tract 1012.10 | Census Tract 1012.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3872 | 06 | 037 | 101210 | 2321 | 686 | 633 | 532 | 313 | 91 | 66 | 0 | 2321 | 702 | 1619 | 2321 | 29 | 433 | 496 | 549 | 232 | 300 | 160 | 107 | 15 | 2321 | 405 | 595 | 808 | 513 | 2321 | 646 | 16 | 36 | 594 | 421 | 0 | 0 | 421 | 376 | 15 | 95 | 266 | 229 | 30 | 32 | 167 | 460 | 247 | 115 | 98 | 114 | 75 | 2402 | 2402 | 463 | 370 | 93 | 70 | 46 | 398 | 799 | 551 | 75 | 0 | 0 | 1984 | 193 | 32 | 57 | 33 | 341 | 719 | 534 | 75 | 0 | 0 | 2321 | 884 | 1152 | 182 | 30 | 73 | 2321 | 18 | 13 | 32 | 29 | 27 | 17 | 65 | 59 | 59 | 98 | 994 | 477 | 185 | 117 | 56 | 75 | 2321 | 287 | 1137 | 700 | 189 | 8 | 0 | 2402 | 33.939390 |
| 3 | 06037101220 | 14000US06037101220 | Census Tract 1012.20 | Census Tract 1012.20, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3873 | 06 | 037 | 101220 | 1294 | 354 | 420 | 163 | 217 | 80 | 60 | 0 | 1294 | 295 | 999 | 1294 | 9 | 142 | 309 | 226 | 155 | 137 | 195 | 83 | 38 | 1294 | 229 | 315 | 495 | 255 | 1294 | 301 | 0 | 9 | 292 | 211 | 9 | 8 | 194 | 301 | 17 | 27 | 257 | 128 | 34 | 57 | 37 | 325 | 180 | 102 | 43 | 28 | 0 | 1328 | 1328 | 729 | 626 | 103 | 14 | 72 | 174 | 175 | 127 | 37 | 0 | 0 | 823 | 222 | 58 | 14 | 72 | 145 | 148 | 127 | 37 | 0 | 0 | 1294 | 596 | 546 | 107 | 21 | 24 | 1294 | 0 | 0 | 42 | 25 | 13 | 49 | 62 | 36 | 48 | 66 | 416 | 277 | 154 | 69 | 37 | 0 | 1294 | 113 | 544 | 419 | 136 | 29 | 53 | 1328 | 26.060610 |
| 4 | 06037101300 | 14000US06037101300 | Census Tract 1013 | Census Tract 1013, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3874 | 06 | 037 | 101300 | 1435 | 270 | 488 | 236 | 326 | 43 | 72 | 0 | 1435 | 61 | 1374 | 1435 | 10 | 87 | 153 | 377 | 199 | 266 | 157 | 99 | 87 | 1435 | 52 | 380 | 465 | 538 | 1435 | 105 | 7 | 6 | 92 | 88 | 31 | 14 | 43 | 184 | 14 | 15 | 155 | 167 | 51 | 24 | 92 | 832 | 489 | 138 | 205 | 53 | 6 | 1584 | 1584 | 1534 | 1443 | 91 | 0 | 7 | 0 | 36 | 0 | 0 | 7 | 0 | 167 | 159 | 0 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 1435 | 920 | 481 | 11 | 0 | 23 | 1435 | 6 | 7 | 22 | 57 | 29 | 60 | 51 | 43 | 70 | 48 | 96 | 99 | 202 | 272 | 367 | 6 | 1435 | 66 | 291 | 575 | 261 | 211 | 31 | 1584 | 26.060610 |
| 5 | 06037101400 | 14000US06037101400 | Census Tract 1014 | Census Tract 1014, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3875 | 06 | 037 | 101400 | 1473 | 426 | 432 | 315 | 182 | 84 | 25 | 9 | 1473 | 240 | 1233 | 1473 | 6 | 178 | 141 | 398 | 142 | 216 | 225 | 90 | 77 | 1473 | 147 | 205 | 529 | 592 | 1473 | 161 | 9 | 0 | 152 | 279 | 29 | 76 | 174 | 71 | 0 | 22 | 49 | 212 | 69 | 10 | 133 | 677 | 224 | 251 | 202 | 9 | 64 | 1614 | 1614 | 1392 | 1344 | 48 | 0 | 10 | 69 | 31 | 99 | 0 | 13 | 0 | 424 | 222 | 9 | 0 | 10 | 40 | 31 | 99 | 0 | 13 | 0 | 1473 | 898 | 536 | 19 | 9 | 11 | 1473 | 0 | 9 | 11 | 30 | 169 | 19 | 35 | 17 | 49 | 30 | 259 | 152 | 144 | 230 | 255 | 64 | 1473 | 121 | 368 | 682 | 204 | 83 | 15 | 1614 | 24.242420 |
| 6 | 06037102103 | 14000US06037102103 | Census Tract 1021.03 | Census Tract 1021.03, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3876 | 06 | 037 | 102103 | 696 | 162 | 251 | 149 | 97 | 37 | 0 | 0 | 696 | 160 | 536 | 696 | 0 | 78 | 130 | 156 | 105 | 47 | 91 | 56 | 33 | 696 | 35 | 180 | 201 | 280 | 696 | 65 | 0 | 0 | 65 | 59 | 0 | 12 | 47 | 57 | 17 | 10 | 30 | 134 | 24 | 9 | 101 | 351 | 120 | 116 | 115 | 7 | 23 | 726 | 726 | 577 | 577 | 0 | 0 | 23 | 0 | 9 | 29 | 88 | 0 | 0 | 239 | 99 | 0 | 0 | 23 | 0 | 9 | 29 | 79 | 0 | 0 | 696 | 440 | 231 | 0 | 21 | 4 | 696 | 0 | 4 | 0 | 0 | 18 | 12 | 19 | 14 | 9 | 14 | 105 | 45 | 182 | 99 | 152 | 23 | 696 | 8 | 241 | 266 | 131 | 50 | 0 | 726 | 7.878788 |
| 7 | 06037102104 | 14000US06037102104 | Census Tract 1021.04 | Census Tract 1021.04, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3877 | 06 | 037 | 102104 | 1270 | 261 | 512 | 221 | 217 | 30 | 29 | 0 | 1270 | 214 | 1056 | 1270 | 19 | 151 | 231 | 142 | 172 | 229 | 163 | 101 | 62 | 1270 | 58 | 271 | 472 | 469 | 1270 | 110 | 0 | 0 | 110 | 87 | 9 | 17 | 61 | 296 | 9 | 0 | 287 | 174 | 57 | 23 | 94 | 578 | 203 | 176 | 199 | 0 | 25 | 1345 | 1345 | 1066 | 586 | 480 | 0 | 91 | 44 | 65 | 0 | 73 | 6 | 0 | 375 | 91 | 150 | 0 | 11 | 31 | 65 | 0 | 27 | 0 | 0 | 1270 | 854 | 386 | 30 | 0 | 0 | 1270 | 0 | 0 | 22 | 9 | 29 | 8 | 59 | 53 | 42 | 13 | 123 | 238 | 175 | 203 | 271 | 25 | 1270 | 83 | 410 | 505 | 117 | 113 | 42 | 1345 | 24.242420 |
| 8 | 06037102105 | 14000US06037102105 | Census Tract 1021.05 | Census Tract 1021.05, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3878 | 06 | 037 | 102105 | 563 | 111 | 138 | 117 | 83 | 68 | 16 | 30 | 563 | 346 | 217 | 563 | 0 | 29 | 182 | 113 | 76 | 75 | 63 | 25 | 0 | 563 | 93 | 163 | 206 | 101 | 563 | 43 | 0 | 6 | 37 | 112 | 0 | 0 | 112 | 77 | 10 | 0 | 67 | 111 | 21 | 24 | 66 | 214 | 82 | 71 | 61 | 0 | 6 | 589 | 589 | 388 | 332 | 56 | 21 | 26 | 28 | 47 | 50 | 24 | 0 | 5 | 293 | 74 | 42 | 16 | 21 | 28 | 47 | 36 | 24 | 0 | 5 | 563 | 221 | 284 | 53 | 5 | 0 | 563 | 0 | 0 | 0 | 6 | 9 | 8 | 9 | 18 | 9 | 15 | 176 | 136 | 92 | 69 | 10 | 6 | 563 | 8 | 203 | 213 | 72 | 32 | 35 | 589 | 9.696970 |
| 9 | 06037102107 | 14000US06037102107 | Census Tract 1021.07 | Census Tract 1021.07, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3879 | 06 | 037 | 102107 | 1305 | 149 | 423 | 294 | 286 | 99 | 44 | 10 | 1305 | 349 | 956 | 1305 | 0 | 63 | 252 | 360 | 191 | 122 | 186 | 91 | 40 | 1305 | 128 | 271 | 512 | 394 | 1305 | 51 | 0 | 0 | 51 | 126 | 0 | 0 | 126 | 84 | 35 | 29 | 20 | 222 | 28 | 61 | 133 | 787 | 478 | 174 | 135 | 0 | 35 | 1352 | 1352 | 1246 | 1101 | 145 | 0 | 7 | 56 | 23 | 13 | 7 | 0 | 0 | 335 | 192 | 44 | 0 | 0 | 56 | 23 | 13 | 7 | 0 | 0 | 1305 | 829 | 435 | 10 | 19 | 12 | 1305 | 0 | 0 | 47 | 0 | 15 | 24 | 70 | 21 | 98 | 58 | 175 | 140 | 179 | 122 | 321 | 35 | 1305 | 51 | 218 | 570 | 285 | 139 | 42 | 1352 | 20.606060 |
Do basis data calculations on total housing unit variable
# Verify data input was correct from earlier
df['TotalHousingUnits'].head(10)
0 1743 1 1391 2 2402 3 1328 4 1584 5 1614 6 726 7 1345 8 589 9 1352 Name: TotalHousingUnits, dtype: int64
# Verify data input was correct from earlier
df['TotalHousingUnits'].mean()
1502.268115942029
# Find total sum of housing units to compare to parcel data later
df['TotalHousingUnits'].sum()
3524321
# Analyze more on occuppied housing units
df['TotalHousingUnits'].describe()
count 2346.000000 mean 1502.268116 std 666.302057 min 0.000000 25% 1065.250000 50% 1405.000000 75% 1855.000000 max 6132.000000 Name: TotalHousingUnits, dtype: float64
# Plot a histogram for practice
df['TotalHousingUnits'].plot.hist(bins=50)
<matplotlib.axes._subplots.AxesSubplot at 0x7f4215cf1820>
# Plot a histogram for practice and comparisons
df['OccupiedHousingUnits'].plot.hist(bins=50)
<matplotlib.axes._subplots.AxesSubplot at 0x7f4213bd3880>
# Double-check rows
len(df)
2346
# Double-check for any null values
df.isna().sum()
FIPS 0 GEOID 0 Geo_NAME 0 Geo_QName 0 Geo_STUSAB 0 Geo_SUMLEV 0 Geo_GEOCOMP 0 Geo_FILEID 0 Geo_LOGRECNO 0 Geo_STATE 0 Geo_COUNTY 0 Geo_TRACT 0 OccupiedHousingUnits 0 1Household 0 2Household 0 3Household 0 4Household 0 5Household 0 6Household 0 7MoreHousehold 0 OccupiedHousingUnits 0 HispanicLatino 0 NotHispanicLatino 0 OccupiedHousingUnits 0 15to24YO 0 25to34YO 0 35to44YO 0 45to54YO 0 55to59YO 0 60to64YO 0 65to74YO 0 75to84YO 0 85MoreYO 0 OccupiedHousingUnits 0 LessHS 0 HSGrad 0 SomeCollege_or_Assoc 0 BachelorMore 0 OccupiedHousingUnits 0 Less20K 0 Less20percent 0 20to29percent 0 30PercentMore 0 20Kto34999 0 Less20percent 0 20to29percent 0 30PercentMore 0 35Kto49999 0 Less20percent 0 20to29percent 0 30PercentMore 0 50Kto74999 0 Less20percent 0 20to29percent 0 30PercentMore 0 75KMore 0 Less20percent 0 20to29percent 0 30PercentMore 0 Zero_or_NegIncome 0 NoCashRent 0 HousingUnits 0 HousingUnits 0 1Unit 0 1_Detached 0 1_Attached 0 2Units 0 3or4Units 0 5to9Units 0 10to19Units 0 20to49Units 0 50MoreUnits 0 MobileHome 0 Boat_RV_Van 0 RenterOccupiedHousingUnits 0 1_Detached 0 1_Attached 0 2Units 0 3or4Units 0 5to9Units 0 10to19Units 0 20to49Units 0 50MoreUnits 0 MobileHome 0 Boat_RV_Van 0 OccupiedHousingUnits 0 0.50orLess_perRM 0 0.51to1_perRM 0 1.01to1.5O_perRM 0 1.51to2_perRM 0 2.01orMore_perRM 0 OccupiedHousingUnits 0 Less100 0 100to199 0 200to299 0 300to399 0 400to499 0 500to599 0 600to699 0 700to799 0 800to899 0 900to999 0 1Kto1499 0 1_5Kto1999 0 2Kto2499 0 2_5Kto2999 0 3KMore 0 NoCashRent 0 OccupiedHousingUnits 0 NoVehic 0 1Vehic 0 2Vehic 0 3Vehic 0 4Vehic 0 5MoreVehic 0 TotalHousingUnits 0 StdErrorHousingUnits 0 dtype: int64
# Plot total housing units to see if there are census tracts that have higher amounts
df.head(10).plot.bar(x='Geo_NAME',
y='TotalHousingUnits')
<matplotlib.axes._subplots.AxesSubplot at 0x7f4213716af0>
# Plot occupied housing units to see if there are census tracts that have higher amounts and compare with above
df.head(10).plot.bar(x='Geo_NAME',
y='OccupiedHousingUnits')
<matplotlib.axes._subplots.AxesSubplot at 0x7f42173c6fd0>
Merge the data between geojson and csv. Then make some basic maps to understand the distribution of total housing units
# Bring in geopandas to merge and map data
import geopandas as gpd
# Bring in geojson to have geometric coordinates to merge and map csv data
tracts=gpd.read_file('la_tracts.geojson')
tracts.head()
| kind | external_id | name | slug | set | metadata | resource_uri | geometry | |
|---|---|---|---|---|---|---|---|---|
| 0 | Census Tract (2012) | 06037101110 | 06037101110 | 06037101110-census-tract-2012 | /1.0/boundary-set/census-tracts-2012/ | {'INTPTLAT': '+34.2594737', 'NAME': '1011.10',... | /1.0/boundary/06037101110-census-tract-2012/ | MULTIPOLYGON (((-118.30229 34.25870, -118.3007... |
| 1 | Census Tract (2012) | 06037101122 | 06037101122 | 06037101122-census-tract-2012 | /1.0/boundary-set/census-tracts-2012/ | {'INTPTLAT': '+34.2677213', 'NAME': '1011.22',... | /1.0/boundary/06037101122-census-tract-2012/ | MULTIPOLYGON (((-118.30333 34.27354, -118.3031... |
| 2 | Census Tract (2012) | 06037101210 | 06037101210 | 06037101210-census-tract-2012 | /1.0/boundary-set/census-tracts-2012/ | {'INTPTLAT': '+34.2529724', 'NAME': '1012.10',... | /1.0/boundary/06037101210-census-tract-2012/ | MULTIPOLYGON (((-118.29945 34.25598, -118.2859... |
| 3 | Census Tract (2012) | 06037101220 | 06037101220 | 06037101220-census-tract-2012 | /1.0/boundary-set/census-tracts-2012/ | {'INTPTLAT': '+34.2516085', 'NAME': '1012.20',... | /1.0/boundary/06037101220-census-tract-2012/ | MULTIPOLYGON (((-118.28592 34.24896, -118.2859... |
| 4 | Census Tract (2012) | 06037101300 | 06037101300 | 06037101300-census-tract-2012 | /1.0/boundary-set/census-tracts-2012/ | {'INTPTLAT': '+34.2487732', 'NAME': '1013', 'I... | /1.0/boundary/06037101300-census-tract-2012/ | MULTIPOLYGON (((-118.27247 34.23253, -118.2719... |
# Double-check geojson data
tracts.info(verbose=True, null_counts=True)
<class 'geopandas.geodataframe.GeoDataFrame'> RangeIndex: 2346 entries, 0 to 2345 Data columns (total 8 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 kind 2346 non-null object 1 external_id 2346 non-null object 2 name 2346 non-null object 3 slug 2346 non-null object 4 set 2346 non-null object 5 metadata 2346 non-null object 6 resource_uri 2346 non-null object 7 geometry 2346 non-null geometry dtypes: geometry(1), object(7) memory usage: 146.8+ KB
# Double-check geojson data
tracts = tracts[['name','geometry']]
tracts.head()
| name | geometry | |
|---|---|---|
| 0 | 06037101110 | MULTIPOLYGON (((-118.30229 34.25870, -118.3007... |
| 1 | 06037101122 | MULTIPOLYGON (((-118.30333 34.27354, -118.3031... |
| 2 | 06037101210 | MULTIPOLYGON (((-118.29945 34.25598, -118.2859... |
| 3 | 06037101220 | MULTIPOLYGON (((-118.28592 34.24896, -118.2859... |
| 4 | 06037101300 | MULTIPOLYGON (((-118.27247 34.23253, -118.2719... |
# Rename the columns
tracts.columns = ['FIPS','geometry']
# Double-check for change
tracts.head(10)
| FIPS | geometry | |
|---|---|---|
| 0 | 06037101110 | MULTIPOLYGON (((-118.30229 34.25870, -118.3007... |
| 1 | 06037101122 | MULTIPOLYGON (((-118.30333 34.27354, -118.3031... |
| 2 | 06037101210 | MULTIPOLYGON (((-118.29945 34.25598, -118.2859... |
| 3 | 06037101220 | MULTIPOLYGON (((-118.28592 34.24896, -118.2859... |
| 4 | 06037101300 | MULTIPOLYGON (((-118.27247 34.23253, -118.2719... |
| 5 | 06037101400 | MULTIPOLYGON (((-118.32188 34.24804, -118.3223... |
| 6 | 06037102103 | MULTIPOLYGON (((-118.36533 34.22870, -118.3506... |
| 7 | 06037102104 | MULTIPOLYGON (((-118.35640 34.21961, -118.3556... |
| 8 | 06037102105 | MULTIPOLYGON (((-118.35309 34.20853, -118.3530... |
| 9 | 06037102107 | MULTIPOLYGON (((-118.36684 34.23236, -118.3678... |
# Do an initial map with geojson data
tracts.plot(figsize=(12,10))
<matplotlib.axes._subplots.AxesSubplot at 0x7f420c620ee0>
# Merge the geojson and csv using FIPS
tracts_housingunits=tracts.merge(df,on="FIPS")
# Double-check if data merged correctly
tracts_housingunits.head(10)
| FIPS | geometry | GEOID | Geo_NAME | Geo_QName | Geo_STUSAB | Geo_SUMLEV | Geo_GEOCOMP | Geo_FILEID | Geo_LOGRECNO | Geo_STATE | Geo_COUNTY | Geo_TRACT | OccupiedHousingUnits | 1Household | 2Household | 3Household | 4Household | 5Household | 6Household | 7MoreHousehold | OccupiedHousingUnits | HispanicLatino | NotHispanicLatino | OccupiedHousingUnits | 15to24YO | 25to34YO | 35to44YO | 45to54YO | 55to59YO | 60to64YO | 65to74YO | 75to84YO | 85MoreYO | OccupiedHousingUnits | LessHS | HSGrad | SomeCollege_or_Assoc | BachelorMore | OccupiedHousingUnits | Less20K | Less20percent | 20to29percent | 30PercentMore | 20Kto34999 | Less20percent | 20to29percent | 30PercentMore | 35Kto49999 | Less20percent | 20to29percent | 30PercentMore | 50Kto74999 | Less20percent | 20to29percent | 30PercentMore | 75KMore | Less20percent | 20to29percent | 30PercentMore | Zero_or_NegIncome | NoCashRent | HousingUnits | HousingUnits | 1Unit | 1_Detached | 1_Attached | 2Units | 3or4Units | 5to9Units | 10to19Units | 20to49Units | 50MoreUnits | MobileHome | Boat_RV_Van | RenterOccupiedHousingUnits | 1_Detached | 1_Attached | 2Units | 3or4Units | 5to9Units | 10to19Units | 20to49Units | 50MoreUnits | MobileHome | Boat_RV_Van | OccupiedHousingUnits | 0.50orLess_perRM | 0.51to1_perRM | 1.01to1.5O_perRM | 1.51to2_perRM | 2.01orMore_perRM | OccupiedHousingUnits | Less100 | 100to199 | 200to299 | 300to399 | 400to499 | 500to599 | 600to699 | 700to799 | 800to899 | 900to999 | 1Kto1499 | 1_5Kto1999 | 2Kto2499 | 2_5Kto2999 | 3KMore | NoCashRent | OccupiedHousingUnits | NoVehic | 1Vehic | 2Vehic | 3Vehic | 4Vehic | 5MoreVehic | TotalHousingUnits | StdErrorHousingUnits | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 06037101110 | MULTIPOLYGON (((-118.30229 34.25870, -118.3007... | 14000US06037101110 | Census Tract 1011.10 | Census Tract 1011.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3870 | 06 | 037 | 101110 | 1596 | 518 | 399 | 286 | 237 | 113 | 43 | 0 | 1596 | 389 | 1207 | 1596 | 37 | 168 | 322 | 356 | 199 | 92 | 243 | 159 | 20 | 1596 | 255 | 336 | 609 | 396 | 1596 | 234 | 0 | 0 | 234 | 249 | 8 | 10 | 231 | 220 | 40 | 6 | 174 | 190 | 24 | 47 | 119 | 604 | 249 | 193 | 162 | 25 | 74 | 1743 | 1743 | 1175 | 1132 | 43 | 75 | 144 | 78 | 142 | 78 | 0 | 29 | 22 | 829 | 362 | 8 | 67 | 114 | 57 | 121 | 78 | 0 | 0 | 22 | 1596 | 934 | 580 | 54 | 8 | 20 | 1596 | 0 | 0 | 19 | 59 | 36 | 0 | 30 | 37 | 77 | 25 | 230 | 445 | 259 | 173 | 132 | 74 | 1596 | 123 | 603 | 501 | 277 | 67 | 25 | 1743 | 26.666670 |
| 1 | 06037101122 | MULTIPOLYGON (((-118.30333 34.27354, -118.3031... | 14000US06037101122 | Census Tract 1011.22 | Census Tract 1011.22, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3871 | 06 | 037 | 101122 | 1256 | 279 | 494 | 212 | 230 | 8 | 33 | 0 | 1256 | 74 | 1182 | 1256 | 6 | 127 | 91 | 303 | 151 | 225 | 223 | 116 | 14 | 1256 | 103 | 288 | 464 | 401 | 1256 | 51 | 0 | 0 | 51 | 92 | 27 | 8 | 57 | 70 | 15 | 0 | 55 | 225 | 15 | 41 | 169 | 776 | 355 | 227 | 194 | 19 | 23 | 1391 | 1391 | 1391 | 1391 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 230 | 230 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1256 | 786 | 408 | 49 | 0 | 13 | 1256 | 0 | 7 | 15 | 14 | 75 | 6 | 15 | 14 | 39 | 18 | 150 | 125 | 265 | 236 | 254 | 23 | 1256 | 7 | 349 | 548 | 199 | 136 | 17 | 1391 | 12.121210 |
| 2 | 06037101210 | MULTIPOLYGON (((-118.29945 34.25598, -118.2859... | 14000US06037101210 | Census Tract 1012.10 | Census Tract 1012.10, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3872 | 06 | 037 | 101210 | 2321 | 686 | 633 | 532 | 313 | 91 | 66 | 0 | 2321 | 702 | 1619 | 2321 | 29 | 433 | 496 | 549 | 232 | 300 | 160 | 107 | 15 | 2321 | 405 | 595 | 808 | 513 | 2321 | 646 | 16 | 36 | 594 | 421 | 0 | 0 | 421 | 376 | 15 | 95 | 266 | 229 | 30 | 32 | 167 | 460 | 247 | 115 | 98 | 114 | 75 | 2402 | 2402 | 463 | 370 | 93 | 70 | 46 | 398 | 799 | 551 | 75 | 0 | 0 | 1984 | 193 | 32 | 57 | 33 | 341 | 719 | 534 | 75 | 0 | 0 | 2321 | 884 | 1152 | 182 | 30 | 73 | 2321 | 18 | 13 | 32 | 29 | 27 | 17 | 65 | 59 | 59 | 98 | 994 | 477 | 185 | 117 | 56 | 75 | 2321 | 287 | 1137 | 700 | 189 | 8 | 0 | 2402 | 33.939390 |
| 3 | 06037101220 | MULTIPOLYGON (((-118.28592 34.24896, -118.2859... | 14000US06037101220 | Census Tract 1012.20 | Census Tract 1012.20, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3873 | 06 | 037 | 101220 | 1294 | 354 | 420 | 163 | 217 | 80 | 60 | 0 | 1294 | 295 | 999 | 1294 | 9 | 142 | 309 | 226 | 155 | 137 | 195 | 83 | 38 | 1294 | 229 | 315 | 495 | 255 | 1294 | 301 | 0 | 9 | 292 | 211 | 9 | 8 | 194 | 301 | 17 | 27 | 257 | 128 | 34 | 57 | 37 | 325 | 180 | 102 | 43 | 28 | 0 | 1328 | 1328 | 729 | 626 | 103 | 14 | 72 | 174 | 175 | 127 | 37 | 0 | 0 | 823 | 222 | 58 | 14 | 72 | 145 | 148 | 127 | 37 | 0 | 0 | 1294 | 596 | 546 | 107 | 21 | 24 | 1294 | 0 | 0 | 42 | 25 | 13 | 49 | 62 | 36 | 48 | 66 | 416 | 277 | 154 | 69 | 37 | 0 | 1294 | 113 | 544 | 419 | 136 | 29 | 53 | 1328 | 26.060610 |
| 4 | 06037101300 | MULTIPOLYGON (((-118.27247 34.23253, -118.2719... | 14000US06037101300 | Census Tract 1013 | Census Tract 1013, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3874 | 06 | 037 | 101300 | 1435 | 270 | 488 | 236 | 326 | 43 | 72 | 0 | 1435 | 61 | 1374 | 1435 | 10 | 87 | 153 | 377 | 199 | 266 | 157 | 99 | 87 | 1435 | 52 | 380 | 465 | 538 | 1435 | 105 | 7 | 6 | 92 | 88 | 31 | 14 | 43 | 184 | 14 | 15 | 155 | 167 | 51 | 24 | 92 | 832 | 489 | 138 | 205 | 53 | 6 | 1584 | 1584 | 1534 | 1443 | 91 | 0 | 7 | 0 | 36 | 0 | 0 | 7 | 0 | 167 | 159 | 0 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 1435 | 920 | 481 | 11 | 0 | 23 | 1435 | 6 | 7 | 22 | 57 | 29 | 60 | 51 | 43 | 70 | 48 | 96 | 99 | 202 | 272 | 367 | 6 | 1435 | 66 | 291 | 575 | 261 | 211 | 31 | 1584 | 26.060610 |
| 5 | 06037101400 | MULTIPOLYGON (((-118.32188 34.24804, -118.3223... | 14000US06037101400 | Census Tract 1014 | Census Tract 1014, Los Angeles County, California | ca | 140 | 0 | ACSSF | 3875 | 06 | 037 | 101400 | 1473 | 426 | 432 | 315 | 182 | 84 | 25 | 9 | 1473 | 240 | 1233 | 1473 | 6 | 178 | 141 | 398 | 142 | 216 | 225 | 90 | 77 | 1473 | 147 | 205 | 529 | 592 | 1473 | 161 | 9 | 0 | 152 | 279 | 29 | 76 | 174 | 71 | 0 | 22 | 49 | 212 | 69 | 10 | 133 | 677 | 224 | 251 | 202 | 9 | 64 | 1614 | 1614 | 1392 | 1344 | 48 | 0 | 10 | 69 | 31 | 99 | 0 | 13 | 0 | 424 | 222 | 9 | 0 | 10 | 40 | 31 | 99 | 0 | 13 | 0 | 1473 | 898 | 536 | 19 | 9 | 11 | 1473 | 0 | 9 | 11 | 30 | 169 | 19 | 35 | 17 | 49 | 30 | 259 | 152 | 144 | 230 | 255 | 64 | 1473 | 121 | 368 | 682 | 204 | 83 | 15 | 1614 | 24.242420 |
| 6 | 06037102103 | MULTIPOLYGON (((-118.36533 34.22870, -118.3506... | 14000US06037102103 | Census Tract 1021.03 | Census Tract 1021.03, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3876 | 06 | 037 | 102103 | 696 | 162 | 251 | 149 | 97 | 37 | 0 | 0 | 696 | 160 | 536 | 696 | 0 | 78 | 130 | 156 | 105 | 47 | 91 | 56 | 33 | 696 | 35 | 180 | 201 | 280 | 696 | 65 | 0 | 0 | 65 | 59 | 0 | 12 | 47 | 57 | 17 | 10 | 30 | 134 | 24 | 9 | 101 | 351 | 120 | 116 | 115 | 7 | 23 | 726 | 726 | 577 | 577 | 0 | 0 | 23 | 0 | 9 | 29 | 88 | 0 | 0 | 239 | 99 | 0 | 0 | 23 | 0 | 9 | 29 | 79 | 0 | 0 | 696 | 440 | 231 | 0 | 21 | 4 | 696 | 0 | 4 | 0 | 0 | 18 | 12 | 19 | 14 | 9 | 14 | 105 | 45 | 182 | 99 | 152 | 23 | 696 | 8 | 241 | 266 | 131 | 50 | 0 | 726 | 7.878788 |
| 7 | 06037102104 | MULTIPOLYGON (((-118.35640 34.21961, -118.3556... | 14000US06037102104 | Census Tract 1021.04 | Census Tract 1021.04, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3877 | 06 | 037 | 102104 | 1270 | 261 | 512 | 221 | 217 | 30 | 29 | 0 | 1270 | 214 | 1056 | 1270 | 19 | 151 | 231 | 142 | 172 | 229 | 163 | 101 | 62 | 1270 | 58 | 271 | 472 | 469 | 1270 | 110 | 0 | 0 | 110 | 87 | 9 | 17 | 61 | 296 | 9 | 0 | 287 | 174 | 57 | 23 | 94 | 578 | 203 | 176 | 199 | 0 | 25 | 1345 | 1345 | 1066 | 586 | 480 | 0 | 91 | 44 | 65 | 0 | 73 | 6 | 0 | 375 | 91 | 150 | 0 | 11 | 31 | 65 | 0 | 27 | 0 | 0 | 1270 | 854 | 386 | 30 | 0 | 0 | 1270 | 0 | 0 | 22 | 9 | 29 | 8 | 59 | 53 | 42 | 13 | 123 | 238 | 175 | 203 | 271 | 25 | 1270 | 83 | 410 | 505 | 117 | 113 | 42 | 1345 | 24.242420 |
| 8 | 06037102105 | MULTIPOLYGON (((-118.35309 34.20853, -118.3530... | 14000US06037102105 | Census Tract 1021.05 | Census Tract 1021.05, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3878 | 06 | 037 | 102105 | 563 | 111 | 138 | 117 | 83 | 68 | 16 | 30 | 563 | 346 | 217 | 563 | 0 | 29 | 182 | 113 | 76 | 75 | 63 | 25 | 0 | 563 | 93 | 163 | 206 | 101 | 563 | 43 | 0 | 6 | 37 | 112 | 0 | 0 | 112 | 77 | 10 | 0 | 67 | 111 | 21 | 24 | 66 | 214 | 82 | 71 | 61 | 0 | 6 | 589 | 589 | 388 | 332 | 56 | 21 | 26 | 28 | 47 | 50 | 24 | 0 | 5 | 293 | 74 | 42 | 16 | 21 | 28 | 47 | 36 | 24 | 0 | 5 | 563 | 221 | 284 | 53 | 5 | 0 | 563 | 0 | 0 | 0 | 6 | 9 | 8 | 9 | 18 | 9 | 15 | 176 | 136 | 92 | 69 | 10 | 6 | 563 | 8 | 203 | 213 | 72 | 32 | 35 | 589 | 9.696970 |
| 9 | 06037102107 | MULTIPOLYGON (((-118.36684 34.23236, -118.3678... | 14000US06037102107 | Census Tract 1021.07 | Census Tract 1021.07, Los Angeles County, Cali... | ca | 140 | 0 | ACSSF | 3879 | 06 | 037 | 102107 | 1305 | 149 | 423 | 294 | 286 | 99 | 44 | 10 | 1305 | 349 | 956 | 1305 | 0 | 63 | 252 | 360 | 191 | 122 | 186 | 91 | 40 | 1305 | 128 | 271 | 512 | 394 | 1305 | 51 | 0 | 0 | 51 | 126 | 0 | 0 | 126 | 84 | 35 | 29 | 20 | 222 | 28 | 61 | 133 | 787 | 478 | 174 | 135 | 0 | 35 | 1352 | 1352 | 1246 | 1101 | 145 | 0 | 7 | 56 | 23 | 13 | 7 | 0 | 0 | 335 | 192 | 44 | 0 | 0 | 56 | 23 | 13 | 7 | 0 | 0 | 1305 | 829 | 435 | 10 | 19 | 12 | 1305 | 0 | 0 | 47 | 0 | 15 | 24 | 70 | 21 | 98 | 58 | 175 | 140 | 179 | 122 | 321 | 35 | 1305 | 51 | 218 | 570 | 285 | 139 | 42 | 1352 | 20.606060 |
# Produce map 1
tracts_housingunits.plot(figsize=(12,10),
column='TotalHousingUnits',
legend=True,
scheme='NaturalBreaks')
<matplotlib.axes._subplots.AxesSubplot at 0x7f420c6f82e0>
# Produce map 2
tracts_housingunits.plot(figsize=(12,10),
column='TotalHousingUnits',
legend=True,
scheme='equal_interval')
<matplotlib.axes._subplots.AxesSubplot at 0x7f41ff339670>
# Produce map 3
tracts_housingunits.plot(figsize=(12,10),
column='TotalHousingUnits',
legend=True,
scheme='quantiles')
<matplotlib.axes._subplots.AxesSubplot at 0x7f41fd825f70>
Practicing how to use folium to produce interactive chrolopleth map
# Bring in folium to help create interactive map
import folium
# Use folium code from class but make following adjustments to make it work
coordinates = [34.2,-118.2]
map = folium.Map(location=coordinates, tiles='OpenStreetMap', zoom_start=9.5)
folium.Choropleth(
geo_data='la_tracts.geojson1' ,
name='choropleth',
data=tracts_housingunits,
columns = ['FIPS','TotalHousingUnits'],
key_on='feature.properties.name',
fill_color='YlOrRd',
fill_opacity=0.6,
line_opacity=0.2,
legend_name='Total Housing Units (2014 - 2018 ACS 5 Year)').add_to(map)
map
#save
map.save('LA_HousingUnits.html')
Daniel worked on examining the Social Explorer Census data on total housing units. Jorge will examine the total housing units from parcel data. This comparison will help show us any discrepancy and figure out indicators of ADU presence.